<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<title>后台登录</title>
<link rel="shortcut icon" type="image/x-icon" href="/images/logo.png">
<link rel="stylesheet" href="/login/css/normalize.css" />
<link rel="stylesheet" href="/login/css/demo.css" />
<!--必要样式-->
<link rel="stylesheet" href="/login/css/component.css" />
<link rel="stylesheet" href="/login/css/loaders.css" />

<!--[if IE]>
<script src="js/html5.js"></script>
<![endif]-->
	<style type="text/css">

		h2 {
			text-align: center;
			text-transform: uppercase;
			font-size: 3em;
			letter-spacing: 0.1em;
			color: #EEE;
			font-family: 隶书;
			animation: rotate 2s ease-in-out alternate infinite;
		}
		h2:before {
			content: attr(data-shadow);
			color: transparent;
			text-shadow: 0 0 15px #111;
			position: absolute;
			z-index: -1;
			margin: -0.1em 0 0 0;
			animation: skew 2s ease-in-out alternate infinite;
			transform-origin: bottom;
		}
		@keyframes rotate {
			from {
				transform: rotateY(-10deg);
				text-shadow:  1px -1px #CCC,
				2px -1px #BBB,
				3px -2px #AAA,
				4px -2px #999,
				5px -3px #888,
				6px -3px #777;
			}
			to {
				transform: rotateY(10deg);
				text-shadow:  -1px -1px #CCC,
				-2px -1px #BBB,
				-3px -2px #AAA,
				-4px -2px #999,
				-5px -3px #888,
				-6px -3px #777;
			}
		}
		@keyframes skew {
			from {
				transform: scaleY(0.3) skewX(-15deg);
			}
			to {
				transform: scaleY(0.3) skewX(-20deg);
			}
		}
	</style>
</head>
<body>
		<div class="container demo-1">
			<div class="content">
				<div id="large-header" class="large-header">
					<canvas id="demo-canvas"></canvas>
					<div class="logo_box">
						<h2 style="padding-bottom: 30px"><!-- yalinyee --></h2>
						<form action="#" name="f" method="post">
							<div class="input_outer">
								<span class="u_user"></span>
								<input name="username" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
							</div>
							<div class="input_outer">
								<span class="us_uer"></span>
								<input name="password" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
							</div>
							<p id="error-msg"></p>
							<div class="mb2"><a id="submit" class="act-but submit" style="color: #FFFFFF">登录</a></div>
							<div id="load" class="loader" style="text-align: center;display: none"></div>
						    <div class="loader-inner ball-pulse">
						      <div></div>
						      <div></div>
						      <div></div>
						    </div>
						</form>
					</div>
				</div>
			</div>
			<script>
			document.addEventListener('DOMContentLoaded', function () {
		  	document.querySelector('main').className += 'loaded';
				});
		</script>
		<script src="/login/js/TweenLite.min.js"></script>
		<script src="/login/js/EasePack.min.js"></script>
		<script src="/login/js/rAF.js"></script>
		<script src="/login/js/demo-1.js"></script>
<!-- jQuery 3 -->
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="/plugins/iCheck/icheck.min.js"></script>
<script>
	//TOCMAT重启之后 在ifrme框架登录后，重新跳出框架显示页面
	if (window != top) {
		top.location.href = location.href;
	}
	
  $(function () {
	  $(document).keydown(function(e) {  
          if (e.keyCode == 13) {  
    	    $("#submit").trigger("click");
    	}
    });
    	
    $("#submit").click(function(){
    	if(checkLogin()){
      		$("#load").show();
			$.ajax({
				type:"POST",
		        url:"/login",
		        data:{username:$("input[name='username']").val(), password:$("input[name='password']").val(),time:new Date().getTime()},
		        dataType:"json",
		        cache:false,
		        success: function(data){
		       	 if("success" == data.status){
		       		 window.location.href="/index";
		       	 }else{
		       		 $("#error-msg").html(data.msg);
		       		 $("#load").hide();
		       	 }
		        }
			})
		}
    	return false;
    });
    
    
    function checkLogin(){
    	if($("input[name='username']").val() == ""){
    		alert("请输入帐号")
    		$("input[name='username']").focus();
    		return false;
    	}
    	if($("input[name='password']").val() == ""){
    		alert("请输入密码")
    		$("input[name='password']").focus();
    		return false;
    	}
    	return true;
    }
  });
</script>
</script>
		<div style="text-align:center;">
</div>
	</body>
</html>